package liuyang.bigeventserver.modules.article.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 视频
 * https://www.bilibili.com/video/BV14z4y1N7pg/?p=33&spm_id_from=pageDriver&vd_source=8bd7b24b38e3e12c558d839b352b32f4
 *
 * @auth xconf
 * @since 20240303
 */
@Documented
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = StateValidation.class)
public @interface State {

    // 可以参考NotEmpty.java
    String message() default "状态必须是已发布或草稿。";

    Class<?>[] groups() default {};

    // 获取到State注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
